package com.esl.service.admin.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import com.esl.dao.admin.ReportDao;
import com.esl.dto.admin.PageInfo_Dto;
import com.esl.model.admin.Report;
import com.esl.service.admin.ReportManager;

@Service("reportManager")
public class ReportManagerImpl implements ReportManager {
	private ReportDao reportDao;

	@Override
	public void add(Report report) {
		reportDao.save(report);

	}


	@Override
	public void delete(Report report) {
		// reportDao.deleteById(Report, report);

	}

	public ReportDao getReportDAO() {
		return reportDao;
	}

	@Override
	public void modify(Report report) {
		reportDao.saveOrUpdate(report);

	}

	@Override
	public void output() {

	}

	@Override
	public PageInfo_Dto load(int pageNow, int pageSize, String hql,
			String orderBy) {
		return reportDao.findByPageInfo(Report.class, pageNow, pageSize, hql,
				orderBy);
	}

	/*---------------------------------*/
	@Resource
	public void setReportDao(ReportDao reportDao) {
		this.reportDao = reportDao;
	}

}
